﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Serialization;

namespace Configurations
{

    public class TargetManager : ConfigurationManager<Target>//
    {
        // public string TargetFile { get; private set; }////
        // public List<Target> Items { get; set; }
        //public int getTargetCount()
        //{
        //    return Items.Count;
        //}

       
        public override Target getItem(object id)
        {
            if (this.Items == null) return null;
            foreach (Target t in Items)
            {
                if (t.ID.Equals(id))
                    return t;
            }
            return null;
        }
        //public Target getItem(Guid id)//
        //{

        //    if (this.Items != null)
        //    {
        //        return Items.First(x => x.ID == id);
        //    }
        //    //foreach (Target t in this.Items)
        //    //{
        //    //    if (t.ID.Equals(id))
        //    //        return t;

        //    else
        //        return null;
        //    //Target target = new Target();
        //    //target.ID = id;
        //    //return target;

        //}
        public TargetManager()
        {
            //this.XmlFile = @"C:\WorkSpace\PFM-Config.XML";
            this.XmlFile = @"D:\Temp\PFM-Config.XML";
        }
    }
}
        

    

